﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLBS.Data.Interface;
using NLBS.Entity;
namespace NLBS.Data.SqlDataService
{
   public class CommentService:ICommentService
    {
        private DbProvider db
        {
            get
            {
                return DbProvider.Instance();
            }
        }
        #region ICommentService Members

        public IList<Comment> GetCommentList()
        {
           return db.GetCommentList();
        }

        public IPagedCollection<Comment> GetCommentBySearch(int startIndex, int pageSize, string prefix)
        {
            return db.GetCommentBySearch(startIndex, pageSize, prefix);
        }

        public IList<Comment> GetCommentListByArticleID(int articleID)
        {
            return db.GetCommentListByArticleID(articleID);
        }

        public IList<Comment> GetCommentListByUserID(int userID)
        {
            return db.GetCommentListByUserID(userID);
        }

        public Comment GetCommentByID(int commID)
        {
            return db.GetCommentByID(commID);
        }

        public int InsertComment(Comment comm)
        {
            return db.InsertComment(comm);
        }

        public void UpdateComment(Comment comm)
        {
            db.UpdateComment(comm);
        }

        public void DeleteComment(int commID)
        {
            db.DeleteComment(commID);
        }

        public IList<Comment> GetTopComment(int intCount)
        {
            return db.GetTopComment(intCount);
        }

        public int GetAllCommentCount()
        {
            return db.GetAllCommentCount();
        }

        public IPagedCollection<Comment> GetAllCommentByPage(int startIndex, int pageSize)
        {
            return db.GetAllCommentByPage(startIndex, pageSize);
        }

        public void UpdateCommentCount(int logID, int authorID)
        {
            db.UpdateCommentCount(logID, authorID);
        }

        #endregion
    }
}
